package com.zhuss.job.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.job.job.DetailJobAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.job.db.dao.ext.JobAppendDao;


/**
 * 查询职位Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("jobAppendRead")
public class JobAppendRead {
	
	@Autowired
	private JobAppendDao jobAppendDao;
	
	
	public List<DetailJobAppendVo> listByType(Integer type, Long jobId, Long creatorId) {
		List<DetailJobAppendVo> list = jobAppendDao.listByType(type, jobId, creatorId);
		return list;
	}
	
	public DetailJobAppendVo getByType(Integer type, Long jobId, Long creatorId) {
		DetailJobAppendVo result = jobAppendDao.getByType(type, jobId, creatorId);
		return result;
	}
	
	/**
	 * 职位Append详情
	 * @param jobAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long jobAppendId) throws WpsException {
		Object result = jobAppendDao.detail(jobAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
